package com.example.bootcurriculumproject.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.bootcurriculumproject.entity.User;
import org.apache.ibatis.annotations.*;

@Mapper
    public interface UserMapper extends BaseMapper<User>{
@Insert("insert into user(username,password,status,address,phone,image) values (#{username},#{password},#{status},#{address},#{phone},#{image})")
int insert(User user);
@Update("update user set username=#{username},password=#{password},status=#{status},address=#{address},phone=#{phone},image=#{image} where uid=#{uid}")
    void updateUser(User user);
@Delete("delete from user where uid=#{uid}")
    void deleteUser(String uid);
@Select("select * from user where username=#{uid}")
    User selectByUid(String uid);
    @Select("select status from user where uid=#{uid}")
    int getStatus(String uid);

    @Update("update user set status=#{status} where uid=#{uid}")
    void updateStatus(String uid,int status);
}
